﻿using System;
using UnityEngine;
using UnityEngine.UI;

namespace Studio
{
	// Token: 0x020005C2 RID: 1474
	public class SoundButtonCtrl : MonoBehaviour
	{
		// Token: 0x0600258B RID: 9611 RVA: 0x000DE518 File Offset: 0x000DC718
		public void OnClickButton(int _idx)
		{
			this.select = ((this.select != _idx) ? _idx : -1);
			for (int i = 0; i < this.ciRoot.Length; i++)
			{
				this.ciRoot[i].active = (i == this.select);
			}
		}

		// Token: 0x0600258C RID: 9612 RVA: 0x000DE570 File Offset: 0x000DC770
		private void Start()
		{
			this.select = -1;
		}

		// Token: 0x04002600 RID: 9728
		[SerializeField]
		private SoundButtonCtrl.CommonInfo[] ciRoot;

		// Token: 0x04002601 RID: 9729
		private int select = -1;

		// Token: 0x020005C3 RID: 1475
		[Serializable]
		private class CommonInfo
		{
			// Token: 0x1700048B RID: 1163
			// (set) Token: 0x0600258E RID: 9614 RVA: 0x000DE584 File Offset: 0x000DC784
			public bool active
			{
				set
				{
					if (this.obj && this.obj.activeSelf != value)
					{
						this.obj.SetActive(value);
						this.button.image.color = ((!value) ? Color.white : Color.green);
					}
				}
			}

			// Token: 0x04002602 RID: 9730
			public GameObject obj;

			// Token: 0x04002603 RID: 9731
			public Button button;
		}
	}
}
